<!doctype html>
<!--  vim: set sw=2 ts=2 et : --> 
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>BrowserHack</title>
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="browserhack.css">
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-61692520-1', 'auto');
  ga('send', 'pageview');
</script>
  </head>
  <body>
    <a href="https://github.com/coolwanglu/browserhack"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/c6286ade715e9bea433b4705870de482a654f78a/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png"></a>
    <div id="github-star">
      <iframe src="http://ghbtns.com/github-btn.html?user=coolwanglu&repo=browserhack&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
    </div>
    <div class="container">
      <div class="jumbotron">
        <h1>BrowserHack<sup>beta</sup></h1>
        <p>Click <a href="https://github.com/coolwanglu/BrowserHack/wiki/BrowserHack-Help">here</a> for help</p>
      </div>
      <div id="browserhack-main" class="container">
        <div id="browserhack-wrapper">
          <div id="browserhack-map">
            <div id="browserhack-map-content" class="smooth-scrolling"></div>
            <div id="browserhack-input-area" class="alert alert-info fade">
            </div>
            <div id="browserhack-map-overlay" class="fade">
              <div id="browserhack-rip">
                <img src="rip.png">
                <div id="browserhack-rip-text"></div>
              </div>
              <div id="browserhack-exited">
                <h1>Game Over</h1>
              </div>
              <button id="browserhack-replay-btn" type="button" class="btn btn-default">Replay</button>
            </div>
          </div>
          <div id="browserhack-message"></div>
          <div id="browserhack-status"></div>
          <div id="browserhack-sidebar">
            <h4><strong>Inventory</strong></h4>
            <br/>
            <div id="browserhack-inventory"></div>
          </div>
        </div>
        <div id="browserhack-toolbar">
          <div id="browserhack-toggle-zoom" class="btn" title="Toggle zoom (s-space)">
            <span class="glyphicon glyphicon-zoom-in"></span>
            <span class="glyphicon glyphicon-zoom-out"></span>
          </div><div id="browserhack-toggle-tileset" class="btn" title="Toggle tileset">
            <span class="glyphicon glyphicon-th-large"></span>
          </div><div id="browserhack-options" class="btn" title="Options">
            <span class="glyphicon glyphicon-cog"></span>
          </div><div id="browserhack-toggle-fullscreen" class="btn" title="Toggle fullscreen">
            <span class="glyphicon glyphicon-resize-full"></span>
            <span class="glyphicon glyphicon-resize-small"></span>
          </div>
        </div>
        <div id="browserhack-loading">
          <div class="jumbotron">
            <br>
            <br>
            <h2>Loading...</h2>
            <h5>This may take a while for the first time.</h5>
            <br>
            <div class="progress">
              <div id="browserhack-loading-progress-bar" class="progress-bar progress-bar-striped active" class="progress-bar" style="width: 0%;"></div>
            </div>
          </div>
        </div> 
        <a target="_blank" href="http://www.kongregate.com/games/coolwanglu/browserhack"><img src="http://cdn1.kongcdn.com/images/sharedassets/badge_dev_220x25.png" width="220" height="25" alt="Kongregate Games logo" style="position:absolute;left:100.2%;bottom:100.2%;transform:rotate(90deg);transform-origin:0 100%;"></a>
      </div>
      <br/>
      <div class="footer">
        <p>© <a target="_blank" href="http://coolwanglu.github.io/">Lu Wang</a> 2015</p>
      </div>
      <!-- Preload images, use inline styles just in case the images are loaded before CSS -->
      <div style="position:fixed;top:200%;left:200%">
        <img src="Default_32.png">
        <img src="DawnHack_32.png">
        <img src="Absurd_32.png">
        <img src="Nevanda_32.png">
        <img src="Geoduck_40x24.png">
      </div>
    </div>
    <script>
      var Module;
      (function() {
      if(window.parent != window.top) {
        if(!/^https?:\/\/www.kongregate.com\/games\/coolwanglu\/browserhack/.test(window.parent.referrer)) {
          alert(':(');
          document.body.innerHTML = '';
          return;
        }
        document.body.classList.add('kongregate');
      }

      Module = {
        noInitialRun: false,
        noExitRuntime: true,
        preRun: [ function() { nethack.pre_run(); } ],
        postRun: [],
        setStatus: function() {
          try {
            var loaded = 0;
            var total = 0;
            for(var f in Module.dataFileDownloads) {
              var info = Module.dataFileDownloads[f];
              total += info.total;
              loaded += info.loaded;
            }
            var percent = loaded / total * 100 + '%';
            var ele = document.getElementById('browserhack-loading-progress-bar');
            ele.style.width = percent;
          } catch(e) {
            console.log(e);
          }
        },
        print: function(text) { 
          if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
          console.log(text); 
        },
        printErr: function(text) { 
          if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
          console.error(text); 
        }
      };
      })();
    </script>
    <script async src="browserhack.js"></script>
  </body>
</html>
